<template>
  <div class="div">
    <div
      style="background: red"
      :ref="'a' + i"
      :data-index="i"
      v-for="i in 10"
      :key="i"
    >
      1
    </div>
    <button @click="subjmit">按钮来了</button>
  </div>
</template>
<script>
export default {
  data() {
    return { a: 1, b: 2, message: 'hello' };
  },
  methods: {
    subjmit() {
      const  index  = this.$refs.a5.dataset;
      console.log(index);
      //   this.$refs.dataset.index.scrollIntoView(true);
    },
  },
  beforeCreate() {
    console.log(this.a);
  },
  created() {
    console.log(this.a);
  },
  mounted() {
    console.log(this.b);
  },
};
</script>
<style>
.div {
  margin: 0 atuo;
  padding-bottom: 100px;
}
</style>
